<div class="ltag__stackexchange--container">
  <div class="ltag__stackexchange--title-container">
    <header>
      <div class="ltag__stackexchange--title">
      <% logo_to_use = site == "stackoverflow" ? "stackoverflow-logo.svg" : "stackexchange-logo.svg" %>
        <div class="ltag__stackexchange--header">
          <img src="<%= ActionController::Base.helpers.asset_path(logo_to_use) %>" alt="">
          <a href="<%= post_url %>" target="_blank" rel="noopener noreferrer">
            <%= post_type == "question" ? CGI.unescapeHTML(title) : t("views.liquids.stackexchange.answer.text_html", answer: tag.span(t("views.liquids.stackexchange.answer.answer"), class: "title-flare"), title: CGI.unescapeHTML(title)) %>
          </a>
        </div>
        <div class="ltag__stackexchange--post-metadata">
          <span><%= Time.zone.at(created_at).strftime(t("time.formats.stackexchange")) %></span>
          <% if post_type == "question" %>
            <span><%= t("views.liquids.stackexchange.comments", count: comment_count) %></span>
            <span><%= t("views.liquids.stackexchange.answers", count: answer_count) %></span>
          <% end %>
        </div>
      </div>
      <a class="ltag__stackexchange--score-container" href="<%= post_url %>" target="_blank" rel="noopener noreferrer">
        <img src="<%= ActionController::Base.helpers.asset_path("stackexchange-arrow-up.svg") %>" alt="">
        <div class="ltag__stackexchange--score-number">
          <%= score %>
        </div>
        <img src="<%= ActionController::Base.helpers.asset_path("stackexchange-arrow-down.svg") %>" alt="">
      </a>
    </header>
  </div>
  <div class="ltag__stackexchange--body">
    <p>
      <%= (HTML_Truncator.truncate body, 50).html_safe %>
    </p>
  </div>
  <div class="ltag__stackexchange--btn--container">
    <a href="<%= post_url %>" class="ltag__stackexchange--btn" target="_blank" rel="noopener noreferrer"><%= t("views.liquids.stackexchange.open.#{post_type}") %></a>
  </div>
</div>
